home *** CD-ROM | disk | FTP | other *** search
- Path: rover.ucs.ualberta.ca!nbehzad
- From: nbehzad@ee.ualberta.ca (Nader Behzad)
- Newsgroups: comp.lang.c
- Subject: Floating exception
- Date: 22 Mar 1996 22:39:07 GMT
- Organization: University of Alberta Electrical Engineering Department
- Message-ID: <4iva6b$153m@pulp.ucs.ualberta.ca>
- NNTP-Posting-Host: nyquist.ee.ualberta.ca
- X-Newsreader: TIN [version 1.2 PL2]
-
- Hi all,
-
-
- I just upgraded my gcc to version 2.7.2. My code was working fine
- under gcc2.6.0. Now I get a Floating exception that I can not figure
- out where is comming from. When I run the code through gdb it runs
- fine!! Also when I put a print statement in the main loop (just a
- useless print statement, The code runs fine. In fact the results are
- the same as the code compiled with the older gcc.
- if(!shut_up)fprintf(stdout,"...\n");
- But without this my code crashes and I get a floating point exception.
- By the way I am compiling this code on DEC (64bit architecture) and
- this is the first time that we have ported our code to this machine!!
- Our developing platform is SUN.
-
- This is where my code is acting strange:
-
- main.c:
- void main(int argc, char *argv[])
- {
- ...
- logical intmd1,intmd2,anealF,udist,altdisc,random;
- ...
- parse(&stoptime,&stopthick,&mode,&prstep,&intmd1,&intmd2,&anealF,
- &udist,&altdisc,TRUE,1);
- ...
- }
- udist is assigned a value in the routine:
- parse.c:
- void parse(int *stoptime_p,
- real *stopthick_p,
- char *mode_p,
- int *prstep_p,
- logical *intmd1_p,
- logical *intmd2_p,
- logical *anealF_p,
- logical *udist_p,
- logical *altdisc_p,
- logical first,
- int curr_layer)
- {
- ...
- *udist_p = v_p->value.c == 'T' ? True : False;
- ...
- }
-
- udist is correctly gets assigned a value, but when I look
- at the udist value after the parse function call it is 1023 ??
-
- I dont know whether this has anything to do with the floating exception
- errors?? If you have any suggestions as where I can start looking to
- solve this problem, I would appreciate it.
-
- Thank you in Advance,
- Sincerely,
- Nader
- ---
- ---------------------------------------------------------------------
- | |
- | Nader T. Behzad |
- | e-mail: nbehzad@ee.ualberta.ca |
- | WWW: http://www.ee.ualberta.ca/~nbehzad |
- | |
- |===================================================================|
- | |
- | "Whatever you do will be insignificant, but it is very |
- | important that you do it." --Mahatma Gandhi |
- | |
- ---------------------------------------------------------------------
-